<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
<!--<![endif]-->

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="keywords" content="">

    <title>Page Replacement Algorithms</title>

    {% load static %}
    <link rel="stylesheet" type="text/css" href="{%static 'wikipages/fonts/font-awesome-4.3.0/css/font-awesome.min.css' %}">
    <link rel="stylesheet" type="text/css" href="{%static 'wikipages/css/stroke.css' %}">
    <link rel="stylesheet" type="text/css" href="{%static 'wikipages/css/bootstrap.css' %}">
    <link rel="stylesheet" type="text/css" href="{%static 'wikipages/css/animate.css' %}">
    <link rel="stylesheet" type="text/css" href="{%static 'wikipages/css/prettyPhoto.css' %}">
    <link rel="stylesheet" type="text/css" href="{%static 'wikipages/css/style.css' %}">
    <link rel="stylesheet" type="text/css" href="{%static 'wikipages/js/syntax-highlighter/styles/shCore.css' %}" media="all">
    <link rel="stylesheet" type="text/css" href="{%static 'wikipages/js/syntax-highlighter/styles/shThemeRDark.css' %}" media="all">
    <link rel="stylesheet" type="text/css" href="{%static 'wikipages/css/custom.css' %}">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

    <div id="wrapper">

        <div class="container">

            <section id="top" class="section docs-heading">

                <div class="row">
                    <div class="col-md-12">
                        <div class="big-title text-center">
                            <h1>Page Replacement Algorithms</h1>
                        </div>
                        <!-- end title -->
                    </div>
                    <!-- end 12 -->
                </div>
                <!-- end row -->

                <hr>

            </section>
            <!-- end section -->

            <div class="row">

                <div class="col-md-3">
                    <nav class="docs-sidebar" data-spy="affix" data-offset-top="300" data-offset-bottom="200" role="navigation">
                        <ul class="nav">
                            <li><a href="#line1">Introduction</a></li>
                            <li><a href="#line2">FIFO</a>
                              <ul class="nav">
                                  <li><a href="#line2_1">Description</a></li>
                                  <li><a href="#line2_2">Advantages</a></li>
                                  <li><a href="#line2_3">Disadvantages</a></li>
                                  <!-- <li><a href="#line2_4">Example</a></li> -->
                              </ul>
                            </li>
                            <li><a href="#line3">LRU</a>
                              <ul class="nav">
                                  <li><a href="#line3_1">Description</a></li>
                                  <li><a href="#line3_2">Advantages</a></li>
                                  <li><a href="#line3_3">Disadvantages</a></li>
                                  <!-- <li><a href="#line3_4">Example</a></li> -->
                              </ul>
                            </li>
                            <li><a href="#line4">OPR</a>
                              <ul class="nav">
                                  <li><a href="#line4_1">Description</a></li>
                                  <li><a href="#line4_2">Advantages</a></li>
                                  <li><a href="#line4_3">Disadvantages</a></li>
                                  <!-- <li><a href="#line4_4">Example</a></li> -->
                              </ul>
                            </li>
                        </ul>
                    </nav >
                </div>
                <div class="col-md-9">
                    <section id = "line1" class="welcome">

                        <div class="row">
                            <div class="col-md-12 left-align">
                                <h2 class="dark-text">Introduction<hr></h2>
                                <div class="row">

                                    <div class="col-md-12 full">
                                        <div class="intro1">
                                            <ul>
                                                <!-- <li><strong>Demo Page : </strong><a href="http://themeforest.net/user/surjithctly" target="_blank">Click Here</a></li> -->
                                                <li><strong>Front End Developers : </strong>Arvind Sai K, Kaushik S Kalmady</li>
                                                <li><strong>Backend End Developers : </strong>Arvind Sai K, Kaushik S Kalmady</li>
                                                <li><strong>Content : </strong>Derik Clive</li>
                                            </ul>
                                        </div>

                                        <hr>
                                        <div>
                                            <p> Page replacement algorithms are the techniques using which an Operating System decides which memory pages to swap out, write to disk when a page of memory needs to be allocated. Paging happens whenever a page fault occurs and a free page cannot be used for allocation purpose accounting to reason that pages are not available or the number of free pages is lower than required pages.
                                            </p>

                                            <p> When the page that was selected for replacement and was paged out, is referenced again, it has to read in from disk, and this requires for I/O completion. This process determines the quality of the page replacement algorithm: the lesser the time waiting for page-ins, the better is the algorithm.
                                            </p>

                                            <p> A page replacement algorithm looks at the limited information about accessing the pages provided by hardware, and tries to select which pages should be replaced to minimize the total number of page misses, while balancing it with the costs of primary storage and processor time of the algorithm itself. There are many different page replacement algorithms. We evaluate an algorithm by running it on a particular string of memory reference and computing the number of page faults.
                                            </p>

                                            <h4>Types</h4>
                                            <p>There are 3 major types</p>
                                            <ol>
                                                <li>First In First Out (FIFO)</li>
                                                <li>Least Recently Used (LRU)</li>
                                                <li>Optimal Page Replacement (OPR)</li>
                                            </ol>
                                        </div>
                                    </div>
                                </div>
                                <!-- end row -->
                            </div>
                        </div>
                    <hr>
                    </section>

                    <section id="line2" class="section">

                        <div class="row">
                            <div class="col-md-12 left-align">
                                <h2 class="dark-text">First In First Out<a href="#top">#back to top</a><hr></h2>
                            </div>
                            <!-- end col -->
                        </div>
                        <!-- end row -->

                        <div class="row">
                                <h4 id="line2_1">Description</h4>
                                <p>This is the simplest page replacement algorithm. In this algorithm, operating system keeps track of all pages in the memory in a queue, oldest page is in the front of the queue. When a page needs to be replaced page in the front of the queue is selected for removal.</p>
                            <!-- end col -->
                        </div>
                        <!-- end row -->

                        <hr>
                        <div class="row">
                                <h4 id="line2_2">Advantages</h4>
                                <ol>
                                    <li>Easy to understand and execute.</li>
                                </ol>
                            <!-- end col -->
                        </div>
                        <hr>

                        <div class="row">
                                <h4 id="line2_3">Disadvantages</h4>
                                <ol>
                                    <li>It is not very effective.</li>
                                    <li>System needs to keep track of each frame</li>
                                    <li>Sometimes it behaves abnormally. This behaviour is called Belady’s anomaly</li>
                                    <li>Bad replacement choice increases the page fault rate and slow process execution</lI>
                                </ol>
                            <!-- end col -->
                        </div>
                        <hr>
                        <!-- <div class = "row">
                          <h4 id ="line2_4">Example</h4>
                        </div>
                        <div class="col-md-6">
                            <a href="upload/thumbnail.png" data-rel="prettyPhoto"><img src="images/upload/thumbnail.png" alt="" class="img-responsive img-thumbnail"></a>
                            <h4>Input</h4>
                        </div>

                        <div class="col-md-6">
                            <a href="upload/thumbnail.png" data-rel="prettyPhoto"><img src="images/upload/thumbnail.png" alt="" class="img-responsive img-thumbnail"></a>
                            <h4>Output</h4>
                        </div> -->


                    </section>
                    <!-- end section -->

                    <section id="line3" class="section">
                        <hr>
                        <div class="row">
                            <div class="col-md-12 left-align">
                                <h2 class="dark-text">Least Recently Used<a href="#top">#back to top</a><hr></h2>
                            </div>
                            <!-- end col -->
                        </div>
                        <!-- end row -->

                        <div class="row">
                                <h4 id="line3_1">Description</h4>
                                <p>The Least Recently used (LRU) algorithm replaces the page that has not been used for the longest period of time. It is based on the observation that pages that have not been used for long time will probably remain unused for the longest time and are to be replaced.      </p>
                            <!-- end col -->
                        </div>
                        <!-- end row -->

                        <hr>
                        <div class="row">
                                <h4 id="line3_2">Advantages</h4>
                                <ol>
                                  <li>LRU page replacement algorithm is quiet efficient.</li>
                                  <li>It does not suffer from Belady's Anomaly.</li>
                                </ol>
                            <!-- end col -->
                        </div>
                        <hr>

                        <div class="row">
                                <h4 id="line3_3">Disadvantages</h4>
                                <ol>
                                  <li>Its implementation is not very easy.</li>
                                  <li>Its implementation may require substantial hardware assistance.</li>
                                </ol>
                            <!-- end col -->
                        </div>
                        <hr>
                        <!-- <div class = "row">
                          <h4 id ="line3_4">Example</h4>
                        </div>
                        <div class="col-md-6">
                            <a href="upload/thumbnail.png" data-rel="prettyPhoto"><img src="images/upload/thumbnail.png" alt="" class="img-responsive img-thumbnail"></a>
                            <h4>Input</h4>
                        </div>

                        <div class="col-md-6">
                            <a href="upload/thumbnail.png" data-rel="prettyPhoto"><img src="images/upload/thumbnail.png" alt="" class="img-responsive img-thumbnail"></a>
                            <h4>Output</h4>
                        </div> -->
                    </section>
                    <!-- end section -->
                      <!-- <hr> -->

                    <section id="line4" class="section">

                        <div class="row">
                            <hr>
                            <div class="col-md-12 left-align">
                                <h2 class="dark-text">Optimal Replacement Algorithm<a href="#top">#back to top</a><hr></h2>
                            </div>
                            <!-- end col -->
                        </div>
                        <!-- end row -->

                        <div class="row">
                                <h4 id="line4_1">Description</h4>
                                <p>This algorithm has the lowest page fault. It has been called OPT or MIN. In this algorithm, replace the page that will not be used for the longest period of time. It involves future knowledge. It is better than FIFO and it is twice as good as FIFO.
                                </p>
                            <!-- end col -->
                        </div>
                        <!-- end row -->

                        <hr>
                        <div class="row">
                                <h4 id="line4_2">Advantages</h4>
                                <ol>
                                  <li>LRU page replacement algorithm is quiet efficient.</li>
                                  <li>It does not suffer from Belady's Anomaly.</li>
                                </ol>
                            <!-- end col -->
                        </div>
                        <hr>

                        <div class="row">
                                <h4 id="line4_3">Disadvantages</h4>
                                <ol>
                                  <li>Lowest page fault rate.</li>
                                  <li>Never suffers from Belady’s anomaly.</li>
                                  <li>Twice as good as FIFO Page Replacement Algorithm.</li>
                                </ol>
                            <!-- end col -->
                        </div>
                        <hr>
                        <!-- <div class = "row">
                          <h4 id ="line4_4">Example</h4>
                        </div>
                        <div class="col-md-6">
                            <a href="upload/thumbnail.png" data-rel="prettyPhoto"><img src="images/upload/thumbnail.png" alt="" class="img-responsive img-thumbnail"></a>
                            <h4>Input</h4>
                        </div>

                        <div class="col-md-6">
                            <a href="upload/thumbnail.png" data-rel="prettyPhoto"><img src="images/upload/thumbnail.png" alt="" class="img-responsive img-thumbnail"></a>
                            <h4>Output</h4>
                        </div> -->
                    </section>
                    <!-- end section -->
                </div>
                <!-- // end .col -->

            </div>
            <!-- // end .row -->

        </div>
        <!-- // end container -->

    </div>
    <!-- end wrapper -->

    <script src="{%static 'wikipages/js/jquery.min.js' %}"></script>
    <script src="{%static 'wikipages/js/bootstrap.min.js' %}"></script>
    <script src="{%static 'wikipages/js/retina.js' %}"></script>
    <script src="{%static 'wikipages/js/jquery.fitvids.js' %}"></script>
    <script src="{%static 'wikipages/js/wow.js' %}"></script>
    <script src="{%static 'wikipages/js/jquery.prettyPhoto.js' %}"></script>
    <script src="{%static 'wikipages/js/custom.js' %}"></script>
    <script src="{%static 'wikipages/js/main.js' %}"></script>
    <script src="{%static 'wikipages/js/syntax-highlighter/scripts/shCore.js' %}"></script>
    <script src="{%static 'wikipages/js/syntax-highlighter/scripts/shBrushXml.js' %}"></script>
    <script src="{%static 'wikipages/js/syntax-highlighter/scripts/shBrushCss.js' %}"></script>
    <script src="{%static 'wikipages/js/syntax-highlighter/scripts/shBrushJScript.js' %}"></script>

</body>

</html>
